package com.softwareconstruction.strategy;

import com.softwareconstruction.paper.Paper;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 随机选择论文的策略实现
 */
public class RandomSelectionStrategy implements PaperSelectionStrategy {
    @Override
    public List<Paper> selectPapers(List<Paper> availablePapers, int quantity) {
        List<Paper> shuffled = new ArrayList<>(availablePapers);
        Collections.shuffle(shuffled);
        return shuffled.subList(0, Math.min(quantity, shuffled.size()));
    }
}